import { Level, FETCH_LEVELS_REQUEST, FETCH_LEVELS_SUCCESS, FETCH_LEVELS_FAILURE } from '../types/levelsTypes'

export function getLevels() {
  return { type: FETCH_LEVELS_REQUEST }
}

export function getLevelsSuccess(levels: Array<Level>) {
  return {
    type: FETCH_LEVELS_SUCCESS,
    levels
  }
}

export function getLevelsFailure(error: Error) {
  return {
    type: FETCH_LEVELS_FAILURE,
    error
  }
}